import DynamicElementDefinitionConstant from "../dynamic-element-definition-constant";

export default class EchartElementDataFieldMapping {
  static getMapping(type: string): any | null {
    let mapping: any;

    switch (type) {
      case DynamicElementDefinitionConstant.cpIndexChart:
      case DynamicElementDefinitionConstant.cpMarcoChart:
      case DynamicElementDefinitionConstant.cpMarcoIndustryChart:
        mapping = {
          indexID: 'IDX_ID',
          indexName: 'INDEX_NAME',
          xAxis: 'PUBLISH_DT',
          yAxis: 'INDEX_VAL',
        };
        break;
      case DynamicElementDefinitionConstant.cpIndexMapChart:
        mapping = {
          indexID: 'IDX_ID',
          indexName: 'INDEX_NAME',
          indexValue: 'PRICE',
        };
        break;
    }

    return mapping;
  }
}